isEven.ts
zzmq.dev@gmail.com/shirt[add-ispositive-n-function-new-file] / isEven.ts
@ 2d2cda17
Download
Ladder Summary
- file This file defines and exports an `isEven` function that takes a number argument and returns a boolean indicating whether the number is evenly divisible by two using the modulo operator.
/**
* Determines if a number is even.
*
* @param n - The number to check.
* @returns true if n is even, false otherwise.
*/
export function isEven(n: number): boolean {
return n % 2 === 0;
}